package com.exp.bookhouse.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.exp.bookhouse.swagger.IgnoreSwaggerParameter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;

@ApiModel("用户实体类User")
@TableName("tb_user")
public class myUser {

    @ApiModelProperty(value = "用户id")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户名")
    private String loginUser;   //用户名

    @ApiModelProperty(value = "真实姓名")
    private String userName;    //真实姓名

    @ApiModelProperty(value = "密码")
    private String password;    //密码

    @ApiModelProperty(value = "电话")
    private String phone;       //电话

    @ApiModelProperty(value = "头像url")
    private String headImage;   //头像url

    @ApiModelProperty(value = "地址")
    private String address;     //地址

    @ApiModelProperty(value = "邮箱")
    private String email;       //邮箱

    @ApiModelProperty(value = "创建时间",hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;     //创建时间

    @ApiModelProperty(value = "更新时间",hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;     //更新时间

    @ApiModelProperty(value = "状态   0：禁用  1：开启")
    private Integer status;     //状态   0：禁用  1：开启

    @ApiModelProperty(value = "微信openid")
    private String openid;      //微信openid

    @ApiModelProperty(value = "盐")
    private String salt;    //盐


    @ApiModelProperty(value = "用户拥有的角色列表")
    @IgnoreSwaggerParameter     //不递归展开
    @TableField(exist = false)
    private List<Role> roles;   //用户拥有的角色

    public myUser() {
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLoginUser() {
        return loginUser;
    }

    public void setLoginUser(String loginUser) {
        this.loginUser = loginUser;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getHeadImage() {
        return headImage;
    }

    public void setHeadImage(String headImage) {
        this.headImage = headImage;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    @Override
    public String toString() {
        return "myUser{" +
                "id=" + id +
                ", loginUser='" + loginUser + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", headImage='" + headImage + '\'' +
                ", address='" + address + '\'' +
                ", email='" + email + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", status=" + status +
                ", openid='" + openid + '\'' +
                ", salt='" + salt + '\'' +
                ", roles=" + roles +
                '}';
    }
}
